# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libidn
pkgver=1.42
pkgrel=0
pkgdesc="Encode/Decode library for internationalized domain names"
url="https://www.gnu.org/software/libidn"
arch="all"
license="LGPL-2.1-or-later"
makedepends="help2man texinfo"
checkdepends="diffutils"
subpackages="$pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/libidn/libidn-$pkgver.tar.gz
	format-security.patch
	"

# secfixes:
#   1.33-r0:
#     - CVE-2015-8948
#     - CVE-2016-6261
#     - CVE-2016-6262
#     - CVE-2016-6263

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-nls
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	# only keep man pages
	rm -rf "$pkgdir"/usr/share/info
}

sha512sums="
1a99f0c9aa12cebed2de7db603c203696544cfe093afd7b233b0955f4fbe65440bf637089a624ed74e204abe854b1d16d11b77dc1b8d56c97ba6b20715aeb0d7  libidn-1.42.tar.gz
bc4fc4348ff87615d40cc535b35de6edfe4379720313df1de8d0041609307dec51b1d283da29b562f7d5ab8fd1934ad094ea5df8044341ad206009739e7751c9  format-security.patch
"
